package lab2.text11;

/**
 * Created by Administrator on 2017/10/23.
 */
public class Square extends Rectangle {
    double c;
    Square(double a,double b){
     super(a,b);       }
    public double getDiagonal(){
     c=Math.sqrt(a*a+b*b);
     return c;
    }
    public  void printMyWay(){
        System.out.println("该矩形的长a="+a+"宽b="+b);
        System.out.println("面积s="+area());
        System.out.println("周长l="+primeter());
        System.out.println("对角线d="+getDiagonal());
    }
}
